<div class="page-content">
  <!--pages/order/index.wxml-->
 
<div class="tab">
   <div   v-on:click='setStatus(0)'  :class="status==''?'tabli on':'tabli'"><span>全部</span></div>
   <div   v-on:click='setStatus(2)'   :class="status==2?'tabli on':'tabli'"><span>待处理</span></div>
   <div  v-on:click='setStatus(3)'  :class="status==3?'tabli on':'tabli'"><span>处理中</span></div>
   <div   v-on:click='setStatus(4)'   :class="status==4?'tabli on':'tabli'"><span>已完成</span></div>
</div>
 <section class="errormsgDiv"   v-if="nodata">
    <p class="errormsg">\（￣︶￣）/</p>
    <p class="errormsg2">没有查到相关订单</p>
 </section>


<section v-else> 
    <div class="cart-goods" style="border:none"  v-for="data in listData" v-if="data.sub_order && data.sub_order.order_sn">
    <!-- 扫餐桌码下的订单 -->
    <div v-if='data.order_type=="book"'>
       <router-link :to="{ name: 'bookDetail', params: { order_sn: data.order_sn }}"  class="mymedia">
                <!-- <div class="text-over-hidden">预约： {{data.sub_order.dining_table_name}}</div> -->
                 <div  class="time" style="margin-top: 5px;"> <span class="light">预约名称</span> {{data.sub_order.dining_table_name}}</div>
              <div  class="time "> <span class="light">店名</span>{{data.shop.name}} <span class='pd5-h'>•</span> <a :href="'tel:'+data.shop.hotline"> {{data.shop.hotline}} </a></div>
              <div  class="time"><span class="light">到店时间</span>{{data.sub_order.time}} </div>
              <div  class="time"><span class="light">预约费用</span>{{data.order_amount}} </div>
              
               <div  class="time"><span class="light">联系人</span> {{data.sub_order.contacts}} <span class='pd5-h'>•</span> <a :href="'tel:'+data.sub_order.phone"> {{data.sub_order.phone}} </a> </div>
               <div  class="time"><span class="light">人数</span>{{data.sub_order.people}}  </div>
               <div  class="time"><span class="light">状态</span><span class="color_0">{{data.statusText}}</span></div>
              <div  class="time"><span class="light">备注</span>{{data.sub_order.remark?data.sub_order.remark:'无'}} </div>
              <div class="clear"></div>
            
              
       </router-link>
       <div class="goods-btns" v-if="data.status!=4 && data.status>1">
                  <div class="line mgt10" style="    margin-bottom: 10px;"></div>
                   <a class="order_btn btn2 border_none" @click="book_receiving(data.order_sn)"  v-if="data.status==2">接受预约</a>
                   <a class="order_btn btn border_none" @click="book_cancel(data.order_sn)"  >取消</a>
                    <a class="order_btn btn2 border_none" @click="book_complete(data.order_sn)"  v-if="data.status==3">完成</a>
                  <div class="clear"></div>
              </div>
    </div>
     <!-- 扫餐桌码下的订单 -->
     <div v-if='data.order_type=="orderOffline"'>
        <div class="cart-title">
        <span class="s_left">{{data.shop.name}} • {{data.sub_order.tableInfo.name}}</span>
        <span class="s_right color_0">{{data.sub_order.statusText}}</span>
        <div class="clear"></div>
        </div>
         <router-link :to="{ name: 'eatInHallOrder', params: { order_sn: data.order_sn }}"   :class=" data.sub_order.goods_info.length>1?'goods-item-list goods-item-list-more':'goods-item-list'">
          <div class="goods-item" v-for="item in data.sub_order.goods_info">
                  <image class='image' :src='item.default_img+"?imagediv2/1/w/160/h/160"'></image>
                  <div class='goods-info'>
                    <div class="title1 span-over-hidden" >{{item.goods_name}}</div>
                    <div class="light">{{item.attrs}}</div>
                  </div>
                
                  <div class="clear"></div>
          </div>

           <div class="clear"></div>
        </router-link>
          <div class="goods-bottom">
          共{{data.sub_order.goods_info.length}}件商品 <span>  应付¥ {{data.order_amount}}</span> 
        </div>
        <div class="goods-bottom">
           <span v-if="data.paytypeText"> 支付方式：</span>  <span class=" color_0">{{data.paytypeText}}</span> <span class='pd5-h'></span>  <span> 支付状态：</span>  <span class=" color_0">{{data.payStatusText}}</span> 
        </div>
        <div class="line"></div>
        <div class="goods-bottom color_0"></div>
        <div class="goods-btns">
             <!-- <div class="order_btn btn2 border_none" @click='topay' :data-order_sn="data.order_sn" v-if="data.status==1">收款</div> -->
             <router-link   :to="{ name: 'eatInHallOrder', params: { order_sn: data.order_sn }}" class="order_btn" >查看订单</router-link>
            
             <div class="order_btn btn border_none" @click='eat_in_hall_receiving(data.order_sn)'  v-if="data.sub_order.status==2"  :shop_id="data.shop_id"  :order_sn="data.order_sn">
                接单
            </div>


            <div class="order_btn btn2 border_none"  v-if="data.status>0 && data.status!=4"  :refund_money="data.order_amount"  :order_sn="data.order_sn" :paystatus="data.paystatus"  @click='show_refund_money'  order_type="eat_in_hall">
                取消订单
            </div>



             <div class="order_btn btn border_none"  @click='eat_in_hall_complete(data.order_sn)'  v-if="data.sub_order.status==5"  :shop_id="data.shop_id"  :order_sn="data.order_sn"  >
                完成
            </div>


            <div class="clear"></div>
        </div>
    </div>
     
     <!-- 扫餐桌码下的结束 --> 



    <!-- 商品购买shopping-->

    <div v-if='data.order_type=="shopping"'>
        <div class="cart-title">
        <span class="s_left" style="max-width: 70%;">{{data.shop.name}} • {{data.title}}</span>
        <span class="s_right color_0">{{data.sub_order.statusText}}</span>
        <div class="clear"></div>
        </div>
         <router-link :to="{ name: 'orderDetail', params: { order_sn: data.order_sn }}"   :class=" data.sub_order.goods_info.length>1?'goods-item-list goods-item-list-more':'goods-item-list'">
          <div class="goods-item" v-for="item in data.sub_order.goods_info">
                  <image class='image' :src='item.default_img+"?imagediv2/1/w/160/h/160"'></image>
                  <div class='goods-info'>
                    <div class="title1 span-over-hidden" >{{item.goods_name}}</div>
                    <div class="light">{{item.attrs}}</div>
                  </div>
                
                  <div class="clear"></div>
          </div>

           <div class="clear"></div>
        </router-link>
        <div class="goods-bottom">
          共{{data.sub_order.goods_info.length}}件商品 <span>  实付¥ {{data.order_amount}}
        </div>
        <div class="goods-bottom">
           <span v-if="data.paytypeText"> 支付方式：</span>  <span class=" color_0">{{data.paytypeText}}</span> <span class='pd5-h'></span>  <span> 支付状态：</span>  <span class=" color_0">{{data.payStatusText}}</span> 
        </div>
        <div class="line"></div>
        <div class="goods-bottom color_0">{{data.sub_order.deliver_type}} {{data.sub_order.deliver_time_str}}</div>
        <div class="goods-btns">
            
            
            <router-link   :to="{ name: 'orderDetail', params: { order_sn: data.order_sn }}" class="order_btn" >查看订单</router-link>
     <div class="order_btn btn2" @click='show_refund_money'  v-if="data.status>0  && data.status!=4"  :order_sn="data.order_sn" :shop_id="data.shop_id" :data-refund_money="data.order_amount" :paystatus="data.paystatus" order_type="shopping" >
                取消订单
            </div>
             <div  class="buttonNone order_btn btn4 "  v-if="data.status>1"  :loading="orderPrintloading[data.order_sn]" disabled="orderPrintdisabled[data.order_sn]" @click='orderPrint'  :shop_id="data.shop_id"   :order_sn="data.order_sn">
                打印
            </div>

             

              <div class="order_btn btn"  @click='shopping_complete(data.order_sn)'  v-if="data.sub_order.status==5"  :shop_id="data.shop_id"  :order_sn="data.order_sn">
                完成
            </div>

             <div class="order_btn btn2"  @click='deliverMallOrder' v-if="data.sub_order.status==6"  :shop_id="data.shop_id"  :order_sn="data.order_sn">
                配送
            </div>

              <div class="order_btn btn" @click='shopping_receiving(data.order_sn)'  v-if="data.status==2"  :shop_id="data.shop_id"  :order_sn="data.order_sn">
                接单
            </div>


            <div class="clear"></div>
        </div>
    </div>
     
    <!-- 商品购买shop end -->

    </div>
      
</section>

 <!--自己配送弹出层-->
 <div @click='popup=0' :class="popup==1?'popupBg':'popupHide'"></div>
  <div :class="popup==1?'popup modal-in bw':'popup popupHide'">
    <div class="popup-title">自营配送</div>
    <form id="formSubmit">
       <div class="list-li">
          <div class="li"  >
                <div class="li-input-text">备注</div>
                <div class="li-input">
                  <input placeholder='备注'  name='remark'></input>
                </div>
                <div class="clear"></div>
             </div>

              <div class="li"  >
                <div class="li-input-text">运输单号</div>
                <div class="li-input">
                  <input placeholder='可填写快递单号'  name="tracking_number"   ></input>
                </div>
                <div class="clear"></div>
             </div>

              <div class="btn_group">
              <div class="order_btn btn" @click='deliver_diy'>提交</div>
               <div class="order_btn" @click='popup=0'>取消</div>
               <div class="clear"></div>
            </div>
         </div>
     
    </form>
  </div>
  <!--弹出层-->



 <!--蜂鸟配送弹出层-->
  <div @click='popup2=0' :class="popup2==1?'popupBg':'popupHide'"></div>
  <div :class="popup2==1?'popup modal-in bw':'popup popupHide'">
    <div class="popup-title">蜂鸟配送</div>
    <form id="formSubmit2">
      <div class="list-li">
          <div class="li"  >
                <div class="li-input-text">备注</div>
                <div class="li-input">
                  <input placeholder='备注'     name='remark'></input>
                </div>
                <div class="clear"></div>
             </div>

              <div class="li"  >
                <div class="li-input-text">订单总重量</div>
                <div class="li-input">
                  <input placeholder='订单总重量（kg）'  name="order_weight"   ></input>
                </div>
                <div class="clear"></div>
             </div>
           <div class="btn_group">
              <div class="order_btn btn" @click='deliver'>提交</div>
               <div class="order_btn" @click='popup2=0'>取消</div>
               <div class="clear"></div>
            </div>
         
      </div>
    </form>
  </div>
  <!--弹出层-->



  <!--退款弹出层-->
   <div @click='popup3=0' :class="popup3==1?'popupBg':'popupHide'"></div>
  <div :class="popup3==1?'popup modal-in bw':'popup popupHide'">

       <div class="list-li">
         
             <div class="li"  >
                <div class="li-input-text">备注</div>
                <div class="li-input">
                  <input placeholder='请输入退回备注'   v-model="remark"  name='remark'></input>
                </div>
                <div class="clear"></div>
             </div>

              <div class="li"  >
                <div class="li-input-text">退回金额</div>
                <div class="li-input">
                  <input placeholder='退回金额'  name="refund_money" v-model="refund_money"  ></input>
                </div>
                <div class="clear"></div>
             </div>
            <div class="btn_group">
              <div class="order_btn btn" @click='cancel_order'>提交</div>
               <div class="order_btn" @click='hide_refund_money'>取消</div>
               <div class="clear"></div>
            </div>
         

      </div>
       
  </div>
  <!--弹出层--> 
    
 
</div>
